Overview | Package | Class | Tree | Deprecated | Index | Help | |||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Canvas | +--com.pacist.diamonds.DiamondCanvas | +--com.pacist.diamonds.DrawnButton
Field Summary | |
boolean | armed
Holds Button's armed state. |
byte | behaviour
Holds the current behaviour of the button. |
static int | BUTTON
Button acts as a button. |
java.util.Vector | buttonListeners
|
byte | flags
Holds the notify flags. |
static int | LABEL
Button acts as a label. |
boolean | mouseIn
Internal mouse tracking variable - true if mouse is inside the Button component; false otherwise. |
static int | NOTIFY_ARM
Notify all listeners when button is armed. |
static int | NOTIFY_DISARM
Notify all listeners when button is disarmed. |
static int | RADIO
Button acts as a radio button. |
static int | SHADOW_ALL
Shadow all around. |
static int | SHADOW_BORDER
Shadow on the border. |
static int | SHADOW_BOTTOM
Shadow on bottom. |
static int | SHADOW_LEFT
Shadow on left. |
static int | SHADOW_NONE
No shadow. |
static int | SHADOW_RIGHT
Shadow on right. |
static int | SHADOW_ROUNDED
Rounded shadow. |
static int | SHADOW_TOP
Shadow on top. |
int | shadowType
Shadow used. |
int | state
Current state. |
int | states
Number of states. |
static int | TOGGLE
Button acts as a toggle button. |
boolean | tracking
Internal mouse tracking variable - true mouse has been pressed and held on button; false otherwise. |
static int | TRISTATE
Button acts as a button, but has three different states. |
java.lang.Object | what
Deprecated. |
Fields inherited from class com.pacist.diamonds.DiamondCanvas | |
tipText |
Fields inherited from class java.awt.Component | |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Constructor Summary | |
DrawnButton()
Creates and initializes a DrawnButton object, with the behaviour of a button. |
|
DrawnButton(int behaviour)
Creates and initializes a DrawnButton object, with the specified behaviour. |
|
DrawnButton(java.lang.Object what)
Deprecated. |
|
DrawnButton(java.lang.Object what,
int behaviour)
Deprecated. |
Method Summary | |
void | addActionListener(java.awt.event.ActionListener l)
Adds the specified action listener to receive action events from this button. |
int | getBehaviour()
Returns current behaviour of button. |
java.util.Vector | getButtonListeners()
Returns a Vector of all the current Button listeners. |
int | getNotify()
Returns the notification flags. |
int | getShadowType()
Returns the shadow type for the button. |
int | getState()
Returns the current state. |
boolean | inButton(int x,
int y)
Determines whether a coordinate lies inside the button. |
boolean | isArmed()
Determines whether the button is currently armed. |
boolean | isDown()
Determines whether the button is down or not. |
boolean | isSet()
Determines whether the button is set or not. |
void | mouseClicked(java.awt.event.MouseEvent event)
Invoked when the mouse has been clicked on the DrawnButton. |
void | mouseDragged(java.awt.event.MouseEvent event)
Invoked when a mouse button is pressed on the DrawnButton and then dragged. |
void | mouseEntered(java.awt.event.MouseEvent event)
Invoked when the mouse enters the DrawnButton. |
void | mouseExited(java.awt.event.MouseEvent event)
Invoked when the mouse exits the DrawnButton. |
void | mouseMoved(java.awt.event.MouseEvent event)
Invoked when the mouse button has been moved on the DrawnButton (with no buttons no down). |
void | mousePressed(java.awt.event.MouseEvent event)
Invoked when a mouse button has been pressed on a DrawnButton. |
void | mouseReleased(java.awt.event.MouseEvent event)
Invoked when a mouse button has been released on the DrawnButton. |
void | paintButton(java.awt.Graphics g,
boolean down)
This method is called to redraw the button. |
void | paint(java.awt.Graphics g)
This method is called to repaint this button. |
void | processAction()
Processes action events occurring on this button by dispatching them to any registered ActionListener objects.
|
void | removeActionListener(java.awt.event.ActionListener l)
Removes the specified action listener so that it no longer receives action events from this button. |
void | setArmed(boolean b)
Indicates if the button can be selected or not by the an input device (such as a mouse pointer). |
void | setBehaviour(int b)
Sets the behaviour of the DrawnButton. |
void | set(boolean bSet)
Sets the current state of the button. |
void | setEnabled(boolean b)
Enables or disables this component, depending on the value of the parameter b. |
void | setNotify(int n)
Returns the number of states. |
void | setShadowType(int t)
Sets the shadow for the button. |
void | setState(int s)
Sets the DrawnButton to the specified state. |
void | setStates(int n)
Sets the number of states the DrawnButton has. |
Methods inherited from class com.pacist.diamonds.DiamondCanvas | |
getTipText, mouseEnter, mouseExit, processMouseEvent, setTipText |
Methods inherited from class java.awt.Canvas | |
addNotify, paint |
Methods inherited from class java.awt.Component | |
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getParent, getPeer, getPreferredSize, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paint, paramString, postEvent, preferredSize, prepareImage, prepareImage, printAll, print, processComponentEvent, processEvent, processFocusEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, update, validate |
Methods inherited from class java.lang.Object | |
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait |
Field Detail |
public static final int LABEL
public static final int BUTTON
public static final int TOGGLE
public static final int TRISTATE
public static final int RADIO
public static final int SHADOW_NONE
public static final int SHADOW_LEFT
public static final int SHADOW_RIGHT
public static final int SHADOW_TOP
public static final int SHADOW_BOTTOM
public static final int SHADOW_ALL
public static final int SHADOW_BORDER
public static final int SHADOW_ROUNDED
public static final int NOTIFY_ARM
public static final int NOTIFY_DISARM
protected byte behaviour
protected byte flags
protected int states
protected int state
protected int shadowType
protected boolean armed
protected boolean tracking
true
mouse has been pressed and held on button; false
otherwise.protected boolean mouseIn
true
if mouse is inside the Button component; false
otherwise.protected java.lang.Object what
protected transient java.util.Vector buttonListeners
Constructor Detail |
public DrawnButton()
public DrawnButton(int behaviour)
public DrawnButton(java.lang.Object what)
public DrawnButton(java.lang.Object what, int behaviour)
Method Detail |
public void setBehaviour(int b)
b
- behaviour of button.public int getBehaviour()
int
- current behaviour.public void setStates(int n)
n
- number of states.public void setNotify(int n)
n
- notification mask.int
- the number of states.
public int getStates() {
return states;
}
/**
Sets the notification flags.public int getNotify()
int
- the flag mask.public void setState(int s)
s
- new current state.public int getState()
int
- the current state.public void set(boolean bSet)
bSet
- true
puts button in state 1, false
puts button in state 0.public boolean isSet()
boolean
- true
if button is set; false
otherwise.public boolean isDown()
boolean
- true
if button is down; false
otherwise.public void setShadowType(int t)
public int getShadowType()
int
- the button's shadow type.protected java.util.Vector getButtonListeners()
Vector
- all current Button listeners.public void addActionListener(java.awt.event.ActionListener l)
l
- the action listener.public void removeActionListener(java.awt.event.ActionListener l)
l
- the action listener.public void processAction()
ActionListener
objects.
This method is not called unless action events are enabled for this button. Action events are enabled when one of the following occurs:
ActionListener
object is registered
via addActionListener
.
enableEvents
.
public void paintButton(java.awt.Graphics g, boolean down)
g
- the graphics context.
down
- true
if button is currently held down; false
otherwise.public void paint(java.awt.Graphics g)
g
- the graphics context.public void setEnabled(boolean b)
b
. An enabled component can respond to user
input and generate events. Components are enabled initially by default.
b
- If true
, this component is
enabled; otherwise this component is disabled.public boolean inButton(int x, int y)
x
- the x coordinate.
y
- the y coordinate.boolean
- true
if the given coordinates lie within the button; false
otherwise.public void setArmed(boolean b)
b
- true
to "Arm" the button; false
otherwise.public boolean isArmed()
boolean
- true
if button is armed; false
otherwise.public void mousePressed(java.awt.event.MouseEvent event)
public void mouseReleased(java.awt.event.MouseEvent event)
public void mouseEntered(java.awt.event.MouseEvent event)
public void mouseExited(java.awt.event.MouseEvent event)
public void mouseDragged(java.awt.event.MouseEvent event)
public void mouseClicked(java.awt.event.MouseEvent event)
public void mouseMoved(java.awt.event.MouseEvent event)
Overview | Package | Class | Tree | Deprecated | Index | Help | |||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |